package cn.sypt.yuhao.dao;

import java.sql.SQLException;
import java.util.List;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import cn.itcast.jdbc.TxQueryRunner;
import cn.sypt.yuhao.domain.Bcategory;



public class BcategoryDao {
	private QueryRunner qr = new TxQueryRunner();

	public List<Bcategory> findByaid(String aid) {
		String sql="select * from bcategory where aid=?";
		try {
			System.out.println("aid="+aid);
			List<Bcategory> bcategoryList=qr.query(sql, new BeanListHandler<Bcategory>(Bcategory.class),aid);
			return bcategoryList;
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}
}
